package com.bookseek.xreader.dao;

import java.util.Map;

import org.greenrobot.greendao.AbstractDao;
import org.greenrobot.greendao.AbstractDaoSession;
import org.greenrobot.greendao.database.Database;
import org.greenrobot.greendao.identityscope.IdentityScopeType;
import org.greenrobot.greendao.internal.DaoConfig;

import com.bookseek.xreader.po.THisPo;
import com.bookseek.xreader.po.TMetaPo;

import com.bookseek.xreader.dao.THisPoDao;
import com.bookseek.xreader.dao.TMetaPoDao;

// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT.

/**
 * {@inheritDoc}
 * 
 * @see org.greenrobot.greendao.AbstractDaoSession
 */
public class DaoSession extends AbstractDaoSession {

    private final DaoConfig tHisPoDaoConfig;
    private final DaoConfig tMetaPoDaoConfig;

    private final THisPoDao tHisPoDao;
    private final TMetaPoDao tMetaPoDao;

    public DaoSession(Database db, IdentityScopeType type, Map<Class<? extends AbstractDao<?, ?>>, DaoConfig>
            daoConfigMap) {
        super(db);

        tHisPoDaoConfig = daoConfigMap.get(THisPoDao.class).clone();
        tHisPoDaoConfig.initIdentityScope(type);

        tMetaPoDaoConfig = daoConfigMap.get(TMetaPoDao.class).clone();
        tMetaPoDaoConfig.initIdentityScope(type);

        tHisPoDao = new THisPoDao(tHisPoDaoConfig, this);
        tMetaPoDao = new TMetaPoDao(tMetaPoDaoConfig, this);

        registerDao(THisPo.class, tHisPoDao);
        registerDao(TMetaPo.class, tMetaPoDao);
    }
    
    public void clear() {
        tHisPoDaoConfig.clearIdentityScope();
        tMetaPoDaoConfig.clearIdentityScope();
    }

    public THisPoDao getTHisPoDao() {
        return tHisPoDao;
    }

    public TMetaPoDao getTMetaPoDao() {
        return tMetaPoDao;
    }

}
